package com.github.chirspan.xaas.auth.integration.authenticator;


import com.github.chirspan.xaas.auth.integration.IntegrationAuthentication;
import com.github.chirspan.xaas.security.service.AuthUserDetail;

/**
 * *******description*******
 * <p>
 * *************************
 *
 * @author ChenPan
 * @date 2019/3/29 09:08
 */
public interface IntegrationAuthenticator {

    /**
     * 处理集成认证
     *
     * @param integrationAuthentication
     * @return
     */
    AuthUserDetail authenticate(IntegrationAuthentication integrationAuthentication) throws Exception;


    /**
     * 进行预处理
     *
     * @param integrationAuthentication
     */
    void prepare(IntegrationAuthentication integrationAuthentication);

    /**
     * 判断是否支持集成认证类型
     *
     * @param integrationAuthentication
     * @return
     */
    boolean support(IntegrationAuthentication integrationAuthentication);

    /**
     * 认证结束后执行
     *
     * @param integrationAuthentication
     */
    void complete(IntegrationAuthentication integrationAuthentication);
}
